<?php  
//$reqtrack->afficheArray($walle) ;
//print_r( $data['Procedure']['proc_reference'] );
?>
<?php	echo $form->create('Requirement', array('action'=>'link')); ?>
		<fieldset>
 		<legend><?php __('1. Filtre par catégorie');?></legend> 
		<div class="req_filtre">
		<label for="RequirementRCategory">Categorie :</label>
		<?php 
		echo $form->select('r_category', $categories, null, array('onChange' => 'this.form.submit()'), false);
		?>
		<input type="submit" value="Changer"/>
		</div>
		</fieldset>
		<?php e('</form>') ; ?>

<?php	echo $form->create('Requirement', array('action'=>'link')); ?>
		<fieldset>
 		<legend><?php
		if (isset($proc_reference)){
			e('2. Procédure choisie : '.$proc_reference);
		}else{
			e('2. Choix de la procédure');
		}
		?></legend> 
		<div class="input" style="float:left">
		<label>Procédures : (Autocomplétion -> Tapez 3 lettres minimum)</label>
		<?php e($ajax->autoComplete(
			'Procedure.proc_reference',
			'/requirements/autocomplete/'.$idCat,
			array(
				'minChars' => 3,
				'indicator' => 'ajaxloader',
				'style' => 'display:inline'
			)
		)); ?> 
		<div id="ajaxloader" style="display:none;">
			Chargement...
		</div>
		<input type="submit" style="display:inline; margin-left:5px;" value="Choisir"/>
		</div>
		<div style="float:left">
		<?php 
		if (isset($proc_reference)){
			e('<p style="float:left; width:300px;">Référence : '.$proc_reference.'</p>');
		}
			
		if (isset($proc_title)){
			e('<p style="float:left; margin-left:20px;">Titre : '.$proc_title.'</p>');
		}
		
		if (isset($proc_ptype))
			e('<p style="float:left; clear:both; width:300px;">Type : '.$proc_ptype.'</p>');
			
		if (isset($proc_phase))
			e('<p style="float:left; margin-left:20px;">Phase : '.$proc_phase.'</p>');
		
		if (isset($proc_part))
			e('<p style="float:left; clear:both; width:300px;">Part : '.$proc_part.'</p>');
			
		if (isset($proc_version))
			e('<p style="float:left; margin-left:20px;">Version : '.$proc_version.'</p>');
		
		?>
		</div>
		</fieldset>
		<?php e('</form>') ; ?>



<?php echo $form->create('ProcedureRequirement'); ?>

		<fieldset>
 		<legend><?php __('3. Attachement de requirements');?></legend>
		
		 
		<div id="select_gauche">
		<label for="ProcedureRequirementPraRequirementList">Liste des Requirements disponibles</label>
		<select multiple name="TAB_requirementsDispos[]" size="10" id="ProcedureRequirementPraRequirementDispos">
		<?php  
		foreach ($requirementsDispos as $reqDispo)
		{
 	 		echo '<option value='.$reqDispo['R1']['r_index'].'>'.$reqDispo['R1']['r_reference'].'</option>'; 
		}
		?>  
		</select>
		</div>
		
		
		<div id="fleches_centre">
		<input type="image" style="display:block; margin:75px; margin-bottom: 30px; margin-top: 60px; width: 30px; height: 30px;" src="/ReqTrack/img/FlecheDroite.png" onclick="action_add()"/>
		<input type="image" style="display:block; margin:75px; margin-bottom: 30px; margin-top: 0px; width: 30px; height: 30px;" src="/ReqTrack/img/FlecheGauche.png" onclick="action_del()"/>
		</div>
		
		
		
		
		<div id="select_droite">
		<label for="ProcedureRequirementPraRequirementAssoc">Liste des Requirements associés</label>
		<select multiple name="TAB_requirementsAssocies[]" size="10" id="ProcedureRequirementPraRequirementAssoc">
		<?php  
		foreach ($requirementsAssocies as $reqAssocie)
		{
 	 		echo '<option value='.$reqAssocie['RA']['r_index'].'>'.$reqAssocie['RA']['r_reference'].'</option>'; 
		}
		?>  
		</select>
		</div>
		
		<?php 	echo $form->hidden('Procedure.proc_index');
				echo $form->hidden('Procedure.proc_reference');
		?>
		
		</fieldset>
		 
		<?php //echo $form->end('Ajouter'); ?>
		<?php e('</form>') ; ?>

	



